package com.springcloud.controller;
import com.hongdou.entity.Dept;
import com.hongdou.service.DeptClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RestController
@RequestMapping("consumer")
public class DeptController {

    @Autowired
    private DeptClientService deptClientService;
    @GetMapping("/dept/add")
    public  boolean add(Dept dept){
        return deptClientService.add(dept);
    }
    @GetMapping(value = "/dept/get/{id}")
    public Dept get(@PathVariable("id") Long id){
        Dept dept = deptClientService.get(id);
        return dept;
    }
    @GetMapping("/dept/list")
    public List<Dept> list(){
        return deptClientService.list();
    }
}
